package com.hg.admin.action;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.hg.forSearch.db.dto.ForSearchDTO;
import com.hg.forSearch.service.ForSearchService;
import com.hg.util.action.MbaseAction;

public class ForSearchAction extends MbaseAction
{
	ForSearchService service = new ForSearchService();
	
	public void index(Map root){
		HttpServletRequest request = (HttpServletRequest) root.get("request");
		String name = request.getParameter("name");
		
		if(name.trim().length()>0){
			List<ForSearchDTO> list = service.getAll(name);
			json_return(root, list);
		}else{
			json_return(root, "{}");
		}
	}

}
